<template>
	<div class="theme">
		<van-nav-bar title="使用设置" left-arrow @click-left="onClickLeft" />
		<div class="overlay headTop">
			<div class="overlay-content scrolling">
				<van-cell-group style="margin: 20px 0px;padding: 5px 0px;">
					<van-switch-cell v-model="checked" title="Touch ID" @change="getID" />
				</van-cell-group>
				<van-cell-group style="margin: 20px 0px;padding: 5px 0px;margin-bottom: 10px;">
					<van-switch-cell v-model="checked2" title="隐藏余额" @change="getMoney"/>
				</van-cell-group>
				<div style="font-size: 12px;padding-left: 15px;color: #7d7e80;">
					开启隐私模式后，钱包和资产的余额将会隐藏
				</div>
				<div style="background-color: white;border-bottom: 1px solid rgb(235, 237, 240);">
					<div style="padding: 15px;margin-top: 20px;">
						<van-row @click="Lang">
							<van-col span="11">多语言</van-col>
							<van-col span="11" style="text-align: right;color: rgb(125, 126, 128);" v-if="lang == '简体中文'">简体中文</van-col>
							<van-col span="11" style="text-align: right;color: rgb(125, 126, 128);position: relative;top: 3px;" v-if="lang == 'English'">English</van-col>
							<van-col span="2" style="position: relative;top: 4px;text-align: right;">
								<van-icon name="arrow" color="rgb(125, 126, 128)" />
							</van-col>
						</van-row>
					</div>
				</div>
				<div style="background-color: white;border-bottom: 1px solid rgb(235, 237, 240);">
					<div style="padding: 15px;">
						<van-row @click="Money">
							<van-col span="11">货币单位</van-col>
							<van-col span="11" style="text-align: right;color: rgb(125, 126, 128);position: relative;top: 3px;">CNY</van-col>
							<van-col span="2" style="position: relative;top: 4px;text-align: right;">
								<van-icon name="arrow" color="rgb(125, 126, 128)" />
							</van-col>
						</van-row>
					</div>
				</div>
				<div style="background-color: white;border-bottom: 1px solid rgb(235, 237, 240);">
					<div style="padding: 15px;" @click="$router.push({path: '/NodeSetup'})">
						<van-row>
							<van-col span="22">节点设置</van-col>
							<van-col span="2" style="position: relative;top: 4px;text-align: right;">
								<van-icon name="arrow" color="rgb(125, 126, 128)" />
							</van-col>
						</van-row>
					</div>
				</div>
				<div style="background-color: white;border-bottom: 1px solid rgb(235, 237, 240);">
					<div style="padding: 15px;"  @click="$router.push({path: '/DAppSetting'})">
						<van-row>
							<van-col span="22">DApp 设置</van-col>
							<van-col span="2" style="position: relative;top: 4px;text-align: right;">
								<van-icon name="arrow" color="rgb(125, 126, 128)" />
							</van-col>
						</van-row>
					</div>
				</div>
			</div>
		</div>
		<van-action-sheet v-model="show" :actions="actions" @select="onSelect" />
		<van-action-sheet v-model="show2" :actions="actions2" @select="onSelect2" />
	</div>
</template>

<script>
	let _this;
	export default {
		name: 'Setting',
		components: {},
		props: {},
		data() {
			return {
				show: false,
				actions: [{
						name: '简体中文'
					},
					{
						name: 'English'
					}
				],
				lang: '简体中文',
				show2: false,
				actions2: [{
						name: 'CNY'
					},
					{
						name: 'USDT'
					}
				],
				moneyName: 'CNY',
				checked: false,
				checked2: false
			};
		},
		beforeCreate() {
			_this = this;
		},
		watch: {},
		computed: {},
		methods: {
			onClickLeft() {
				this.$router.push({
					path: '/Mine'
				});
			},
			getID() { // 设置 ID
				console.log(this.checked);
			},
			getMoney() { // 隐藏余额的开关
				console.log(this.checked2);
			},
			Lang() {
				this.show = true;
			},
			Money() {
				this.show2 = true;
			},
			onSelect(item) {
				this.show = false;
				this.lang = item.name;
				this.$toast("您选择的是：" + this.lang);
			},
			onSelect2(item) {
				this.show2 = false;
				this.moneyName = item.name;
				this.$toast("您选择的是：" + this.moneyName);
			}
		},
		created() {},
		mounted() {},
		destroyed() {

		},
		filters: {}
	};
</script>

<style lang="less" scoped>
	.overlay {
		background: rgb(245, 245, 245);
	}
</style>